<?php
/**
 * Created by PhpStorm.
 * User: xushengbin
 * Date: 2017/9/8
 * Time: 15:43
 */

use \GuzzleHttp\Client;
use yii\helpers\ArrayHelper;
require __DIR__ . '/../../bootstrap.php';

$a_1 = [
    'id1'=>[
        'id'=>2,
        'name'=>'zhuqiaozhen'
    ],
    'id4'=>[
        'id'=>1,
        'name'=>'zhuqiaozhen'
    ],
    'id2'=>[
        'id'=>2,
        'name'=>'xushengbin2'
    ]
];
$a_2 =[
    'id1'=>[
        'id'=>1,
        'status'=>'1'
    ]
];
$a_3 = ['id'=>1,'name'=>'xushengbin'];
$a_4 = ['status'=>'333'];
$result = ArrayHelper::merge($a_3,$a_4);
//print_r($result);
$result = array_merge($a_3,$a_4);
//print_r($result);

$result = ArrayHelper::index($a_1,'name');
//print_r($result);

ArrayHelper::multisort($a_1,['name','id']);
print_r($a_1);